/**
 * Thinking in java 
 *  2018/08/01
 */
package com.dzb.nioclient;


/**
 * @author dzb
 * @date 2018年8月15日 下午12:42:37
 * @description  
 * @version 1.0.0
 */
public class NioServers {
	
	
	// work 线程
	public static WorkThread[] workThreads = new WorkThread[3];

	public static void main(String[] args) throws Exception {
		// 创建一个线程，监听8080端口
		Thread bossThread = new BossThread(8080);
		bossThread.start();
		// 启动一定数量的work线程
		for (int i = 0; i < workThreads.length; i++) {
			workThreads[i] = new WorkThread();
			workThreads[i].start();
		}

		// 这代码的意思是 main线程等待boss线程执行完毕后再关闭
		bossThread.join();
	}

}
